 ####################################eclat
library(arules)


m=read.csv("mushrooms.csv")

str(m)

head(m)

t <- as(m, "transactions") #turn data frame into transactions

head(t)
itemsets = eclat (t, parameter = list(supp = 0.1, 
                                          maxlen = 5)) # Min Support as 0.001, confidence as 0.8.

## Display the 5 itemsets with the highest support.
top5 = sort(itemsets)
head(inspect(top5))


## Get the itemsets as a list
as(items(top5), "list")

as(items(top5), "matrix")